import 'package:flutter/material.dart';
import 'package:flutter_hx/theme/font_size.dart';
import 'package:flutter_hx/widgets/ez_image.dart';
import 'package:get/get.dart';

///签到成功对话框
class CheckInDialog extends StatelessWidget {
  const CheckInDialog({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    MediaQuery.of(context).size;
    return GestureDetector(
      onTap: () => Get.back(),
      child: Scaffold(
        backgroundColor: Colors.transparent,
        body: Center(
          child: Padding(
            padding: const EdgeInsets.only(bottom: 100),
            child: GestureDetector(
              onTap: () {},
              child: SizedBox(
                  width: 240,
                  height: 359,
                  child: LayoutBuilder(builder: (context, constraint) {
                    double width = constraint.maxWidth;
                    // double height = constraint.maxHeight;
                    return Stack(
                      alignment: Alignment.topCenter,
                      children: [
                        Positioned(
                          bottom: 0,
                          child: Container(
                            width: width,
                            height: 255.5,
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(15),
                            ),
                            alignment: Alignment.bottomCenter,
                            child: Column(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                const Text(
                                  "恭喜你，签到成功！",
                                  style: TextStyle(
                                    color: Color(0xFF00C3B3),
                                    fontSize: FontSize.pt17,
                                  ),
                                ),
                                const SizedBox(
                                  height: 11,
                                ),
                                const Text(
                                  "明日签到继续领取奖励",
                                  style: TextStyle(
                                      color: Color(0xFF999999),
                                      fontSize: FontSize.pt13),
                                ),
                                const SizedBox(
                                  height: 37.5,
                                ),
                                InkWell(
                                  onTap: () => Get.back(),
                                  child: Container(
                                    width: width - 40,
                                    padding:
                                    const EdgeInsets.symmetric(vertical: 12),
                                    decoration: BoxDecoration(
                                        color: const Color(0xFF00C3B3),
                                        borderRadius: BorderRadius.circular(99),
                                        boxShadow: [
                                          BoxShadow(
                                              offset: const Offset(0, 2),
                                              blurRadius: 5,
                                              color: const Color(0xFF00C3B3)
                                                  .withOpacity(0.25))
                                        ]),
                                    alignment: Alignment.center,
                                    child: const Text(
                                      "我知道了",
                                      style: TextStyle(
                                          color: Colors.white,
                                          fontSize: FontSize.pt15),
                                    ),
                                  ),
                                ),
                                const SizedBox(
                                  height: 24,
                                ),
                              ],
                            ),
                          ),
                        ),
                        const EzImage.asset(
                            "check_in_dialog_shit.png",
                            width: 231.5,
                            height: 231.5,
                          ),
                      ],
                    );
                  })),
            ),
          ),
        ),
      ),
    );
  }
}
